<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<jsp:include page="/admin/header.jsp"></jsp:include>

<div class="main">
	<div class="body container">
		<div class="typecho-page-title">
			<h2>创建新页面</h2>
		</div>
		<div class="row typecho-page-main typecho-post-area" role="form">
			<form action="${options.siteUrl }/action/admin?do=pageEdit"
				method="post" name="write_page">
				<div class="col-mb-12 col-tb-9" role="main">

					<p class="title">
						<label for="title" class="sr-only">标题</label> <input type="text"
							id="title" name="page.title" autocomplete="off"
							value="${page['title'] }" placeholder="标题"
							class="w-100 text title" />
					</p>
					<p class="mono url-slug">
						<label for="slug" class="sr-only">网址缩略名</label>
						localhost/typecho/index.php/<input type="text" id="slug"
							name="page.slug" autocomplete="off" value="${page['slug'] }"
							class="mono" />.html
					</p>
					<p>
						<label for="text" class="sr-only">页面内容</label>
						<textarea style="height: 350px" autocomplete="off" id="text"
							name="page.text" class="w-100 mono">${page['textmd'] }</textarea>
					</p>

					<%-- <section id="custom-field" class="typecho-post-option fold">
						<label id="custom-field-expand" class="typecho-label"><a
							href="##"><i class="i-caret-right"></i> 自定义字段</a></label>
						<table class="typecho-list-table mono">
							<colgroup>
								<col width="25%" />
								<col width="10%" />
								<col width="55%" />
								<col width="10%" />
							</colgroup>
							<tr>
								<td><label for="fieldname" class="sr-only">字段名称</label> <input
									type="text" name="fieldNames[]" placeholder="字段名称"
									id="fieldname" class="text-s w-100"></td>
								<td><label for="fieldtype" class="sr-only">字段类型</label> <select
									name="fieldTypes[]" id="fieldtype">
										<option value="str">字符</option>
										<option value="int">整数</option>
										<option value="float">小数</option>
								</select></td>
								<td><label for="fieldvalue" class="sr-only">字段值</label> <textarea
										name="fieldValues[]" placeholder="字段值" id="fieldvalue"
										class="text-s w-100" rows="2"></textarea></td>
								<td>
									<button type="button" class="btn btn-xs">删除</button>
								</td>
							</tr>
						</table>
						<div class="description clearfix">
							<button type="button" class="btn btn-xs operate-add">+添加字段</button>
							自定义字段可以扩展你的模板功能, 使用方法参见 <a
								href="http://docs.typecho.org/help/custom-fields">帮助文档</a>
						</div>
					</section> --%>
					<p class="submit clearfix">
						<span class="right"> <input type="hidden" name="cid"
							value="${page['cid'] }" /><input type="hidden" name="page.type"
							value="page" />

							<button type="submit" name="page.status" value="draft"
								id="btn-save" class="btn">保存草稿</button>
							<button type="submit" name="page.status" value="publish"
								class="btn primary" id="btn-submit">发布页面</button> <input
							type="hidden" name="markdown" value="1" />
						</span>
					</p>

				</div>
				<div id="edit-secondary" class="col-mb-12 col-tb-3"
					role="complementary">
					<ul class="typecho-option-tabs clearfix">
						<li class="active w-50"><a href="#tab-advance">选项</a></li>
						<li class="w-50"><a href="#tab-files" id="tab-files-btn">附件</a></li>
					</ul>

					<div id="tab-advance" class="tab-content">
						<!-- <section class="typecho-post-option" role="application">
							<label for="date" class="typecho-label">发布日期</label>
							<p>
								<input class="typecho-date w-100" type="text" name="date"
									id="date" value="" />
							</p>
						</section> -->

						<section class="typecho-post-option">
							<label for="order" class="typecho-label">页面顺序</label>
							<p>
								<input type="text" id="order" name="page.order"
									value="${page['order'] }" class="w-100" />
							</p>
							<p class="description">为你的自定义页面设定一个序列值以后, 能够使得它们按此值从小到大排列</p>
						</section>

						<section class="typecho-post-option">
							<label for="template" class="typecho-label">自定义模板</label>
							<p>
								<select name="page.template" id="template">
									<option value="">不选择</option>
								</select>
							</p>
							<p class="description">如果你为此页面选择了一个自定义模板, 系统将按照你选择的模板文件展现它</p>
						</section>


						<button type="button" id="advance-panel-btn" class="btn btn-xs">
							高级选项 <i class="i-caret-down"></i>
						</button>
						<div id="advance-panel">
							<section class="typecho-post-option visibility-option">
								<label for="visibility" class="typecho-label">公开度</label>
								<p>
									<select id="visibility" name="visibility">
										<option value="publish" selected>公开</option>
										<option value="hidden">隐藏</option>
									</select>
								</p>
							</section>

							<section class="typecho-post-option allow-option">
								<label class="typecho-label">权限控制</label>
								<ul>
									<li><c:if test="${editOption.defaultAllowComment==false}">
											<input name="page.allowComment" type="checkbox" value="1"
												id="allowComment">
										</c:if> <c:if test="${editOption.defaultAllowComment==true}">
											<input name="page.allowComment" type="checkbox" value="1"
												id="allowComment" checked>
										</c:if> <label for="allowComment"> 可以被评论</label></li>
									<li><c:if test="${editOption.defaultAllowPing==false}">
											<input name="page.allowPing" type="checkbox" value="1"
												id="allowPing">
										</c:if> <c:if test="${editOption.defaultAllowPing==true}">
											<input name="page.allowPing" type="checkbox" value="1"
												id="allowPing" checked>
										</c:if> <label for="allowPing"> 可以被引用</label></li>
									<li><c:if test="${editOption.defaultAllowFeed==false}">
											<input name="page.allowFeed" type="checkbox" value="1"
												id="allowFeed">
										</c:if> <c:if test="${editOption.defaultAllowFeed==true}">
											<input name="page.allowFeed" type="checkbox" value="1"
												id="allowFeed" checked>
										</c:if> <label for="allowFeed"> 出现在聚合中</label></li>
								</ul>
							</section>

						</div>
					</div>
					<!-- end #tab-advance -->

					<div id="tab-files" class="tab-content hidden">


						<div id="upload-panel" class="p">
							<div class="upload-area" draggable="true">
								拖放文件到这里<br>或者 <a href="###" class="upload-file">选择文件上传</a>
							</div>
							<ul id="file-list">
							</ul>
						</div>

					</div>
					<!-- end #tab-files -->
				</div>
			</form>
		</div>
	</div>
</div>

<jsp:include page="/admin/copyright.jsp"></jsp:include>
<!-- common.js -->
<jsp:include page="/admin/common-js.jsp"></jsp:include>
<!-- common.js -->
<!-- form.js -->
<script src="${options.siteUrl}/admin/js/form.js"></script>
<!-- form.js -->
<!--write.js  -->
<script src="${options.siteUrl}/admin/js/timepicker.js"></script>
<script src="${options.siteUrl}/admin/js/tokeninput.js"></script>
<script src="${options.siteUrl}/admin/js/write.js"></script>
<!--write.js  -->
<!--editor-js  -->
<script src="${options.siteUrl}/admin/js/pagedown.js"></script>
<script src="${options.siteUrl}/admin/js/stmd.js"></script>
<script src="${options.siteUrl}/admin/js/diff.js"></script>
<script src="${options.siteUrl}/admin/js/editor.js"></script>
<!--editor-js  -->
<!-- fileupload-js  -->
<jsp:include page="/admin/fileupload-js.jsp"></jsp:include>
<!-- fileupload-js  -->
<!--custom-field-js  -->
<script src="${options.siteUrl}/admin/js/customfield.js"></script>
<!--custom-field-js  -->
<jsp:include page="/admin/footer.jsp"></jsp:include>
